package cn.xabad.commons.tools;

import android.content.Context;
import android.os.Build;
import android.os.Environment;

import java.io.File;

// +----------------------------------------------------------------------
// | CreateTime: 15/6/18 
// +----------------------------------------------------------------------
// | Author:     xab(http://www.xueyong.net.cn)
// +----------------------------------------------------------------------
// | CopyRight:  http://www.boxfish.cn
// +----------------------------------------------------------------------
public class EnvironmentU {
    public static File getExternalCacheDir(Context context) {
        if (Build.VERSION.SDK_INT > Build.VERSION_CODES.FROYO) {
            return context.getExternalCacheDir();
        }

        final String cacheDir = "/Android/data/" + context.getPackageName()
                + "/cache/";
        return new File(Environment.getExternalStorageDirectory().getPath()
                + cacheDir);
    }
    public static boolean isExitsSdcard() {
        if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED))
            return true;
        else
            return false;
    }
}
